﻿using Rafy;
using Rafy.ComponentModel;
using Rafy.Data;
using Rafy.Domain;
using Rafy.Domain.ORM;
using Rafy.Domain.ORM.Query;
using Rafy.Domain.Validation;
using Rafy.ManagedProperty;
using Rafy.MetaModel;
using Rafy.MetaModel.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Text;
using static Rafy.Domain.ORM.Query.FactoryMethods;

namespace Rafy.Book
{
    /// <summary>
    /// 公共按钮
    /// </summary>
    [RootEntity]
    public partial class Base_PublicButton : BookEntity
    {
        #region 引用属性

        #endregion

        #region 组合子属性

        #endregion

        #region 一般属性
        public static readonly Property<string> F_BtnNameProperty = P<Base_PublicButton>.Register(e => e.F_BtnName);
        /// <summary>
        /// 按钮名称
        /// </summary>
        public string F_BtnName
        {
            get { return this.GetProperty(F_BtnNameProperty); }
            set { this.SetProperty(F_BtnNameProperty, value); }
        }
        public static readonly Property<string> F_NavPageProperty = P<Base_PublicButton>.Register(e => e.F_NavPage);
        /// <summary>
        /// 导航页面
        /// </summary>
        public string F_NavPage
        {
            get { return this.GetProperty(F_NavPageProperty); }
            set { this.SetProperty(F_NavPageProperty, value); }
        }

        public static readonly Property<string> F_BtnInfoProperty = P<Base_PublicButton>.Register(e => e.F_BtnInfo);
        /// <summary>
        /// 按钮信息
        /// </summary>
        public string F_BtnInfo
        {
            get { return this.GetProperty(F_BtnInfoProperty); }
            set { this.SetProperty(F_BtnInfoProperty, value); }
        }
        public static readonly Property<string> F_PramsProperty = P<Base_PublicButton>.Register(e => e.F_Prams);
        /// <summary>
        /// 参数
        /// </summary>
        public string F_Prams
        {
            get { return this.GetProperty(F_PramsProperty); }
            set { this.SetProperty(F_PramsProperty, value); }
        }
        #endregion

        #region 只读属性

        #endregion
    }

    /// <summary>
    /// 公共按钮 列表类。
    /// </summary>
    public partial class Base_PublicButtonList : BookEntityList<Base_PublicButton> { }

    /// <summary>
    /// 公共按钮 仓库类。
    /// 负责 公共按钮 类的查询、保存。
    /// </summary>
    public partial class Base_PublicButtonRepository : BookEntityRepository
    {
        /// <summary>
        /// 单例模式，外界不可以直接构造本对象。
        /// </summary>
        protected Base_PublicButtonRepository() { }
    }

    /// <summary>
    /// 公共按钮 配置类。
    /// 负责 公共按钮 类的实体元数据的配置。
    /// </summary>
    internal class Base_PublicButtonConfig : BookEntityConfig<Base_PublicButton>
    {
        /// <summary>
        /// 配置实体的元数据
        /// </summary>
        protected override void ConfigMeta()
        {
            //配置实体的所有属性都映射到数据表中。
            Meta.MapTable().MapAllProperties();
        }
    }
}